/*
 * @Author: jianfanfan 1217572833@qq.com
 * @Date: 2025-03-15 16:29:52
 * @LastEditors: jianfanfan 1217572833@qq.com
 * @LastEditTime: 2025-03-17 17:19:50
 * @FilePath: \guozaoke\src\config\configuration.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import * as path from 'path';

export default () => ({
  port: parseInt(process.env.PORT || '3000', 10),
  database: {
    host: process.env.DATABASE_HOST,
    port: parseInt(process.env.DATABASE_PORT || '3306', 10),
    user: process.env.DATABASE_USER,
    password: process.env.DATABASE_PASSWORD,
    name: process.env.DATABASE_NAME,
  },
  logger: {
    dir: path.join(process.cwd(), 'logs'),
    level: process.env.LOG_LEVEL || 'debug',
    maxFiles: {
      info: process.env.LOG_MAX_INFO_FILES || '14d',
      error: process.env.LOG_MAX_ERROR_FILES || '30d',
      http: process.env.LOG_MAX_HTTP_FILES || '14d',
    },
    maxSize: process.env.LOG_MAX_SIZE || '20m',
  },
  jwt: {
    secret: process.env.JWT_SECRET || 'guozaokenestjwtsecrethardtoguess',
    expiresIn: process.env.JWT_EXPIRES_IN || '7d',
  },
});
